package models

import (
	"gorm.io/gorm"
	"hitme/go-api/modules/db"
)

var IdcardModel = new(Idcard)

// 证件照规格表V1
type Idcard struct {
	db.CommonModel
	ItemId   uint64 `gorm:"index;default:0;NOT NULL;comment:规格ID" json:"item_id"`
	SpecName string `gorm:"type:varchar(100);default:'';NOT NULL;comment:规格名称" json:"spec_name"`
	WidthPx  string `gorm:"type:varchar(100);default:'';NOT NULL;comment:规格像素宽" json:"width_px"`
	HeightPx string `gorm:"type:varchar(100);default:'';NOT NULL;comment:规格像素高" json:"height_px"`
	WidthMm  string `gorm:"type:varchar(100);default:'';NOT NULL;comment:规格冲印宽" json:"width_mm"`
	HeightMm string `gorm:"type:varchar(100);default:'';NOT NULL;comment:规格冲印高" json:"height_mm"`
	Dpi      string `gorm:"type:varchar(100);default:'';NOT NULL;comment:dpi" json:"dpi"`
	IsHot    int8   `gorm:"index;type:tinyint(1);default:0;comment:是否热门" json:"is_hot"`
	CateName string `gorm:"type:varchar(255);default:'';comment:分类" json:"cate_name"`
	Colors   string `gorm:"type:varchar(255);default:'';comment:颜色" json:"colors"`
}

func (m *Idcard) TableName() string {
	return "id_card"
}

func (m *Idcard) Model() *gorm.DB {
	return db.MysqlDB.Model(&m)
}